package com.test.demo.controller;

import com.test.demo.model.Student;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Controller;

@Controller
public class HelloController {

    private Student student;

//    @Autowired
//    public HelloController(Student student){
//        this.student = student;
//    }

    @Autowired
    public void setStudent(Student student) {
        this.student = student;
    }



    public void getStudent(){
        System.out.println(student.getName());
    }
    public void print(){
        System.out.println("hello,controller");
    }

}
